SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 58635: "ERROR: An exception has been encountered" might occur when you use the OPEN function with the %SYSFUNC macro function

DetailsAboutRate It

Error messages like the following can occur if the OPEN function is invoked with the %SYSFUNC macro function in a LABEL or FORMAT statement within a procedure step:

ERROR:  An exception has been encountered.
Please contact technical support and provide them with the following traceback information:

The SAS task name is [procedure-name]
Exception occurred at (06D81593)
Task Traceback
Address   Frame     (DBGHELP API Version 4.0 rev 5)
06D81593  0788C3EC  sasxattr:\ysachg.c\ysachg 119 +(0x3)
071BDDFF  0788CB8C  sasyoio:\yosopen.c\yyoopen 4112 +(0x1B)
071B7071  0788CBEC  sasyoio:\yosopen.c\yoopen 671 +(0xB)
...

The example code below generates the error:

%macro checkDSV(dset);
   %let dsid=%sysfunc(open(&dset));
   %let rc=%sysfunc(close(&dsid));
   0
%mend checkDSV;

data tmp;
   WEKcode="1234567"; 
run;  
                                                                                                         
%macro CzCmF(infile);
   proc print data=&infile;
      label WEKcode="WEKcode"
      %if %checkDSV(&infile) %then %do;
      %end;;
   run;
%mend CzCmF;
%CzCmF(tmp);  

To circumvent the problem, move the OPEN function outside of the LABEL statement. For example:

%macro CzCmF(infile);        
   %let val=%checkDSV(&infile);
   proc print data=&infile;    
      label WEKcode="WEKcode"   
      %if &val %then %do;      
      %end;;                   
   run;                        
%mend CzCmF;                 


Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASz/OS9.4 TS1M09.4 TS1M4
z/OS 64-bit9.4 TS1M09.4 TS1M4
Microsoft® Windows® for x649.4 TS1M09.4 TS1M4
Microsoft Windows 8 Enterprise x649.4 TS1M09.4 TS1M4
Microsoft Windows 8 Pro x649.4 TS1M09.4 TS1M4
Microsoft Windows 8.1 Enterprise 32-bit9.4 TS1M09.4 TS1M4
Microsoft Windows 8.1 Enterprise x649.4 TS1M09.4 TS1M4
Microsoft Windows 8.1 Pro 32-bit9.4 TS1M09.4 TS1M4
Microsoft Windows 8.1 Pro x649.4 TS1M09.4 TS1M4
Microsoft Windows 109.4 TS1M09.4 TS1M4
Microsoft Windows Server 2008 R29.4 TS1M09.4 TS1M4
Microsoft Windows Server 2008 for x649.4 TS1M09.4 TS1M4
Microsoft Windows Server 2012 Datacenter9.4 TS1M09.4 TS1M4
Microsoft Windows Server 2012 R2 Datacenter9.4 TS1M09.4 TS1M4
Microsoft Windows Server 2012 R2 Std9.4 TS1M09.4 TS1M4
Microsoft Windows Server 2012 Std9.4 TS1M09.4 TS1M4
Windows 7 Enterprise x649.4 TS1M09.4 TS1M4
Windows 7 Professional x649.4 TS1M09.4 TS1M4
64-bit Enabled AIX9.4 TS1M09.4 TS1M4
64-bit Enabled Solaris9.4 TS1M09.4 TS1M4
HP-UX IPF9.4 TS1M09.4 TS1M4
Linux for x649.4 TS1M09.4 TS1M4
Solaris for x649.4 TS1M09.4 TS1M4
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.